import com.zaxxer.hikari.HikariDataSource;

import java.sql.Connection;
import java.sql.SQLException;

public class HikaridDemo {
    public static void main(String[] args) {
        HikariDataSource ds = new HikariDataSource();
        ds.setJdbcUrl("jdbc:mysql://localhost:3306/jdbc");
        ds.setUsername("root");
        ds.setPassword("20050324");
        ds.setDriverClassName("com.mysql.jdbc.Driver");
        ds.setMaximumPoolSize(10);
        ds.setMinimumIdle(5);
        ds.setConnectionTimeout(30000);
       try{
           Connection connection = ds.getConnection();
           if(connection!=null){
               System.out.println("连接成功");
           }
       }catch(SQLException e){
           throw new RuntimeException(e);
       }
    }

   }



